cmake_minimum_required(VERSION 3.1)
project(p_paxos)
set(CMAKE_CXX_STANDARD 14)
add_definitions(-g)


include_directories(p_paxos)
include_directories(p_paxos/include)
include_directories(p_paxos/include/lmdb_include)
include_directories(p_paxos/evpaxos)
include_directories(p_paxos/paxos)
include_directories(p_paxos/evpaxos/include)
include_directories(p_paxos/paxos/include)
include_directories(p_paxos/hiredis)


AUX_SOURCE_DIRECTORY(p_paxos/evpaxos e_src)
AUX_SOURCE_DIRECTORY(p_paxos/paxos p_src)
AUX_SOURCE_DIRECTORY(p_paxos/hiredis redis_src)
AUX_SOURCE_DIRECTORY(p_paxos pp_src)

link_directories(lib)
link_directories(lib/libevent)


add_library(t_paxos STATIC
        ${e_src}
        ${p_src}
        ${redis_src}
        ${pp_src} p_paxos/learner_xy.h)


add_executable(p_paxos test_main.cpp job.cpp z_hglog.cpp zmqpipe.cpp)
target_link_libraries(p_paxos t_paxos event zmq  pthread rt dl)




#include_directories(include)
#include_directories(hiredis)
#include_directories(include/lmdb_include)
#include_directories(evpaxos)
#include_directories(evpaxos/include)
#include_directories(paxos)
#include_directories(paxos/include)
#
#
#AUX_SOURCE_DIRECTORY(evpaxos p_src)
#AUX_SOURCE_DIRECTORY(paxos p_src)
#AUX_SOURCE_DIRECTORY(hiredis p_src)
#
#
#add_library(t_paxos STATIC
#        ${p_src}
#        pnode.cpp
#        role_node.cpp)

